﻿using System;
using System.Collections.Generic;
using System.Text;


using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;
using OT.Module.ModelConst;
using OT.Common;
using OT.EntLib.Validate;

namespace OT.Module.Model
{

    [Persistent(GDB.Org_Department)]
    public class Org_Department : XPLiteObject
    {
        #region ~

        public Org_Department()
            : base(new Session())
        {

        }

        public Org_Department(Session s)
            : base(s)
        {
        }

        public Org_Department(Session s, XPClassInfo info)
            : base(s, info)
        {
        }

        #endregion


        #region ID  标识
        private string _ID = "";

        [Key(false)]

        public string ID
        {
            get
            {
                return _ID;
            }
            set
            {
                SetPropertyValue("ID", ref _ID, value);
            }
        }
        #endregion

        #region DepPositions
        [Association("Org_Department-Org_DepPositions", typeof(Org_DepPosition))]
        public XPCollection<Org_DepPosition> DepartmentPositions { get { return GetCollection<Org_DepPosition>("Org_DepPositions"); } }
        #endregion


        #region Departments
        [Association("Org_Department-Org_Departments", typeof(Org_Department))]
        public XPCollection<Org_Department> Departments { get { return GetCollection<Org_Department>("Org_Departments"); } }
        #endregion


        #region Employees
        [Association("Org_Department-Org_Employees", typeof(Org_Employee))]
        public XPCollection<Org_Employee> Employees { get { return GetCollection<Org_Employee>("Org_Employees"); } }
        #endregion


        #region PID  父标识
        private Org_Department _PID;

        [Association("Org_Department-Org_Departments")]
        [Persistent("PID")]
        public Org_Department ParentDepartment
        {
            get
            {
                return _PID;
            }
            set
            {
                SetPropertyValue("ParentDepartment", ref _PID, value);
            }
        }
        #endregion


        #region CompanyID  公司标识
        private Org_Company _CompanyID;

        [Association("Org_Company-Org_Departments")]
        [Persistent("CompanyID")]
        public Org_Company BelongCompany
        {
            get
            {
                return _CompanyID;
            }
            set
            {
                SetPropertyValue("BelongCompany", ref _CompanyID, value);
            }
        }
        #endregion


        #region DepaCode  部门编码
        private string _DepaCode = "";
        [DisplayName(GSyntax.Org_Department.DepaCode), Size(10)]
        public string DepaCode
        {
            get
            {
                return _DepaCode;
            }
            set
            {
                SetPropertyValue("DepaCode", ref _DepaCode, value);
            }
        }
        #endregion


        #region DepaName  部门名称
        private string _DepaName = "";
        [DisplayName(GSyntax.Org_Department.DepaName), Size(50)]
        public string DepaName
        {
            get
            {
                return _DepaName;
            }
            set
            {
                SetPropertyValue("DepaName", ref _DepaName, value);
            }
        }
        #endregion


        #region DepaDesc  职责范围
        private string _DepaDesc = "";
        [DisplayName(GSyntax.Org_Department.DepaDesc), Size(200)]
        public string DepaDesc
        {
            get
            {
                return _DepaDesc;
            }
            set
            {
                SetPropertyValue("DepaDesc", ref _DepaDesc, value);
            }
        }
        #endregion


        #region DepaSerial  排序
        private string _DepaSerial = "";
        [DisplayName(GSyntax.Org_Department.DepaSerial), Size(2)]
        public string DepaSerial
        {
            get
            {
                return _DepaSerial;
            }
            set
            {
                SetPropertyValue("DepaSerial", ref _DepaSerial, value);
            }
        }
        #endregion


        #region Depamanager  负责人
        private string _Depamanager = "";
        [DisplayName(GSyntax.Org_Department.Depamanager), Size(40)]
        public string Depamanager
        {
            get
            {
                return _Depamanager;
            }
            set
            {
                SetPropertyValue("Depamanager", ref _Depamanager, value);
            }
        }
        #endregion


        #region Status  初始\确认\作废
        private string _Status = "";
        [DisplayName(GSyntax.Org_Department.Status), Size(14)]
        public string Status
        {
            get
            {
                return _Status;
            }
            set
            {
                SetPropertyValue("Status", ref _Status, value);
            }
        }
        #endregion


    }

}
